/**
 * 
 */
package com.mdgafur.android_object_oriented_programming_AppDatabase;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * @author Md Abdul Gafur
 * Bangladesh, Dhaka.
 * Khulna University.
 * CSE 07 Batch.
 */
public class DataBaseHelper extends SQLiteOpenHelper {

	private static final String DATABASE_NAME = "android_sample.sqlite";
	private static final int DATABASE_VERSION = 1;

	public static final String DATABASE_TABLE_NAME = "news_table";

	public static final String COLUMN_TITLE = "Title";
	public static final String COLUMN_LINK = "Link";
	public static final String COLUMN_DESCROPTION = "Description";
	public static final String COLUMN_DATE = "Date";
	public static final String COLUMN_IMAGE = "Image";
	public static final String COLUMN_CATEGORY = "Category";

	public static final String CREATE_DATABASE_TABLE = "CREATE TABLE IF NOT EXISTS "
			+ DATABASE_TABLE_NAME
			+ " ( "
			+ COLUMN_TITLE
			+ " VARCHAR NOT NULL, "
			+ COLUMN_LINK
			+ " VARCHAR NOT NULL, "
			+ COLUMN_DESCROPTION
			+ " VARCHAR NOT NULL, "
			+ COLUMN_DATE
			+ " VARCHAR NOT NULL, "
			+ COLUMN_IMAGE
			+ " VARCHAR NOT NULL, "
			+ COLUMN_CATEGORY + " VARCHAR NOT NULL );";

	public DataBaseHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
		// TODO Auto-generated constructor stub
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * android.database.sqlite.SQLiteOpenHelper#onCreate(android.database.sqlite
	 * .SQLiteDatabase)
	 */
	@Override
	public void onCreate(SQLiteDatabase sqLiteDatabase) {
		sqLiteDatabase.execSQL(CREATE_DATABASE_TABLE);

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * android.database.sqlite.SQLiteOpenHelper#onUpgrade(android.database.sqlite
	 * .SQLiteDatabase, int, int)
	 */
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}
